﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace epk23.PartIIProject
{
    public class Register : ICloneable
    {
        public String regName { get; set; }
        public int value { get; set; }

        public Register(String regName, int value)
        {
            this.regName = regName;
            this.value = value;
        }

        public void increment()
        {
            this.value++;
        }

        public void decrement() //returns true if zero
        {
            this.value--;
        }

        public object Clone()
        {
            Register newRegister = new Register(regName, value);
            return newRegister;
        }
    }
}
